/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cratos.xxgram.platf.rongcloud;

import org.redkale.util.Comment;

/**
 * 内容类消息
 *
 * @author SquRab
 */
public abstract class BasicContent extends BaseContent {

    @Comment("文字消息")
    public static final String OBJ_TEXT_MESSAGE = "RC:TxtMsg";

    @Comment("语音消息")
    public static final String OBJ_VPOICE_MESSAGE = "RC:VcMsg";

    @Comment("文件类的消息")
    public static final String OBJ_FILE_MESSAGE = "RC:FileMsg";

    @Comment("小视频消息")
    public static final String OBJ_SIGTH_MESSAGE = "RC:SightMsg";

    @Comment("位置消息")
    public static final String OBJ_LBS_MESSAGE = "RC:LBSMsg";

    @Comment("图文消息")
    public static final String OBJ_IMAGE_TEXT_MESSAGE = "RC:ImgTextMsg";

    @Comment("群聊自定义消息")
    public static final String LOCAL_OBJ_GROUP_MESSAGE = "LOCAL:GroupMsg";

    /**
     * 文件类型消息
     *
     * @author SquRab
     */
    public static class FileMessage extends BasicContent {

        @Comment("文件类消息")
        public transient static final String TYPE = OBJ_FILE_MESSAGE;

        @Comment("文件名称")
        private String name;

        @Comment("文件大小 bytes")
        private int size;

        @Comment("文件类型。")
        private String type; //txt

        @Comment("文件地址")
        private String fileUrl; // http://www.demo.com/am.ind

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getSize() {
            return size;
        }

        public void setSize(int size) {
            this.size = size;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getFileUrl() {
            return fileUrl;
        }

        public void setFileUrl(String fileUrl) {
            this.fileUrl = fileUrl;
        }
    }

    /**
     * 小视频消息¶
     *
     * @author SquRab
     */
    public static class SightMessage extends BasicContent {

        @Comment("小视频消息")
        public transient static final String TYPE = OBJ_SIGTH_MESSAGE;

        @Comment("上传到文件服务器的小视频地址。")
        private String sightUrl;

        @Comment("小视频首帧的缩略图进行 Base64 编码的结果值，格式为 JPG，注意在 Base64 进行 Encode 后需要将所有 \\r\\n 和 \\r 和 \\n 替换成空。")
        private String content;

        @Comment("视频时长，单位：秒。")
        private int duration;

        @Comment("视频大小单位 bytes。")
        private int size;

        @Comment("发送端视频的文件名，小视频文件格式为 .mp4。")
        private String name;

        public String getSightUrl() {
            return sightUrl;
        }

        public void setSightUrl(String sightUrl) {
            this.sightUrl = sightUrl;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public int getDuration() {
            return duration;
        }

        public void setDuration(int duration) {
            this.duration = duration;
        }

        public int getSize() {
            return size;
        }

        public void setSize(int size) {
            this.size = size;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

    }

    /**
     *
     * @author SquRab
     */
    @Comment("文字消息")
    public static class TextMessage extends BasicContent {

        @Comment("文本消息")
        public transient static final String TYPE = OBJ_TEXT_MESSAGE;

        @Comment("文字消息的文字内容，包括表情。")
        public String content = "";

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public TextMessage(String content) {
            this.content = content;
        }

    }

    /**
     * 位置消息¶ 用来发送地理位置消息，客户端收到消息后计入未读消息数、进行存储。
     */
    public static class LocationMessage extends BasicContent {

        @Comment("位置消息")
        public transient static final String TYPE = OBJ_LBS_MESSAGE;

        @Comment("表示位置图片缩略图，格式为 JPG，以 Base64 进行 Encode 后需要将所有 \\r\\n 和 \\r 和 \\n 替换成空。")
        private String content;

        @Comment("位置的纬度值。")
        private double latitude;

        @Comment("位置的经度值。")
        private double longitude;

        @Comment("表示位置的 poi 信息。")
        private String poi;

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public double getLatitude() {
            return latitude;
        }

        public void setLatitude(double latitude) {
            this.latitude = latitude;
        }

        public double getLongitude() {
            return longitude;
        }

        public void setLongitude(double longitude) {
            this.longitude = longitude;
        }

        public String getPoi() {
            return poi;
        }

        public void setPoi(String poi) {
            this.poi = poi;
        }

    }

    /**
     * 图文消息
     */
    public static class RichContentMessage extends BasicContent {

        @Comment("图文消息")
        public transient static final String TYPE = OBJ_IMAGE_TEXT_MESSAGE;

        @Comment("标题")
        private String title;

        @Comment("消息的文字内容。")
        private String content;

        @Comment("消息中图片地址，图片尺寸为：120 x 120 像素。")
        private String imageUri;

        @Comment("点击图片消息后跳转的 URL 地址。")
        private String url;

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getImageUri() {
            return imageUri;
        }

        public void setImageUri(String imageUri) {
            this.imageUri = imageUri;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }

    @Comment("群聊自定义消息")
    public static class GroupContentMessage extends BasicContent {

        @Comment("群聊消息")
        public transient static final String TYPE = LOCAL_OBJ_GROUP_MESSAGE;

        public MentionedInfo mentionedInfo;

        @Comment("消息内容")
        public String content;

        public MentionedInfo getMentionedInfo() {
            return mentionedInfo;
        }

        public void setMentionedInfo(MentionedInfo mentionedInfo) {
            this.mentionedInfo = mentionedInfo;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        @Comment("群聊消息功能 比如 @XXX")
        public static class MentionedInfo {

            @Comment("@ 功能类型，1 表示 @ 所有人、2 表示 @ 指定用户。（必传）")
            int type;

            @Comment("指定用户列表，type 为 2 时有效，为 1 时 userIdList 可以为空。（非必传）")
            String[] userIdList;

            @Comment("@ 消息的自定义 Push 内容。（非必传）")
            private String mentionedContent;

            public int getType() {
                return type;
            }

            public void setType(int type) {
                this.type = type;
            }

            public String[] getUserIdList() {
                return userIdList;
            }

            public void setUserIdList(String[] userIdList) {
                this.userIdList = userIdList;
            }

            public String getMentionedContent() {
                return mentionedContent;
            }

            public void setMentionedContent(String mentionedContent) {
                this.mentionedContent = mentionedContent;
            }

            public MentionedInfo(int type, String[] userIdList, String mentionedContent) {
                this.type = type;
                this.userIdList = userIdList;
                this.mentionedContent = mentionedContent;
            }
        }
    }
}
